<template>
  <div class="app-box">
    <Layout ref="runBox"
            title="非自动出飞车辆登记"
            temp="Temp3"
            :autoCommit="autoCommit"
            :custom="custom"
            @handleSuccessMqttMessage="handleSuccessMqttMessage"
            :ic="ic"
            :url="url"
            :readID="false"
            :readIC="false"></Layout>
  </div>
</template> 
<script>
import Layout from '../core/layout.vue'
import { GSAConstants } from '@/utils/access'
import {
  log,
} from '@/utils/message'
export default {
  components: { Layout },
  data () {
    return {
      ic: GSAConstants().TOPIC_MANUAL_SSD.ic,
      url: GSAConstants().TOPIC_MANUAL_SSD.url,
      autoCommit: false,
      readOnlyForm: {},
      custom: {
        tips: '请输入相应的公司信息和司机信息',
        showReturnReceiptId: false,
        pccInput: true,
        nameInput: true,
        manTelRequire: true,
        reasons: [{
          value: '无PCC卡',
          label: '无PCC卡'
        }, {
          value: '无身份证明证件',
          label: '无身份证明证件'
        }, {
          value: '无效PCC卡',
          label: '无效PCC卡'
        }, {
          value: '无效身份证明证件',
          label: '无效身份证明证件'
        }, {
          value: '违章车辆',
          label: '违章车辆'
        }, {
          value: '被锁车辆',
          label: '被锁车辆'
        }, {
          value: '黑名单车辆',
          label: '黑名单车辆'
        }, {
          value: '黑名单司机',
          label: '黑名单司机'
        }, {
          value: '无从业资格证司机',
          label: '无从业资格证司机'
        }, {
          value: '已注销车辆',
          label: '已注销车辆'
        }, {
          value: '无年审车辆',
          label: '无年审车辆'
        }]
      }
    }
  },
  created () {

  },
  mounted () {
  },
  methods: {
    showMsg (msg, type) {
      this.$refs.runBox.showMsg(msg, type)
    },
    // 读卡成功的回调信息
    handleSuccessMqttMessage (messageObject) {
      if (messageObject.ic === this.ic) {
        if (messageObject.dt === -2) {
          this.$confirm('一年内使用“非自动出飞车辆登记”超过3次，是否继续办理登记?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            this.$refs.runBox.doPageFun('skipCheck')
          })
        } else {
          this.showMsg('作业处理成功', 'green')
          // this.$refs.runBox.handleSuccess()
        }
      }
    }
  },
}
</script>

<style scoped>
.app-box {
  padding: 0px;
}
</style>
